<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="col-sm-12">
			<div class="ibox">
				<div class="ibox-body">
					<div class="fixed-table-toolbar">
						<div class="columns pull-right" role="group">
							<button class="btn btn-success" onclick="reLoad()">
								<i class="fa fa-search" aria-hidden="true"></i>查询
							</button>
							<button class="btn btn-danger" shiro:hasPermission="finance:commission:export" onclick="exportCommissionsLogs()">
								<i class="fa fa-mail-reply-all" aria-hidden="true"></i>导出
							</button>
						</div>
						<div class="columns pull-left">
							<button shiro:hasPermission="finance:commission:batchGrant"  type="button" class="btn  btn-danger"
									onclick="batchGrant()"><i class="fa fa-check" aria-hidden="true"></i>批量发放
							</button>
						</div>

						<div class="columns pull-right col-md-1 nopadding">
							<select id="isGrant" data-placeholder="发放状态" class="form-control chosen-select" tabindex="2">
								<option value="">发放状态</option>
								<option value="0" selected>未发放</option>
								<option value="1">已发放</option>
							</select>
						</div>
						<div class="pull-right search col-md-1 nopadding">
							<input id="queryItem" type="text" class="form-control" placeholder="姓名/ID/昵称">
						</div>
						<div class="columns pull-right col-md-1 nopadding">
							<select id="type" data-placeholder="佣金类型" class="form-control chosen-select" tabindex="2">
								<option value="" selected="selected">佣金类型</option>
								<option value="1">门店佣金</option>
								<option value="2">门店推荐人佣金</option>
								<option value="3">商户推荐佣金</option>
								<option value="4">商户代理佣金</option>
								<option value="5">推荐人佣金</option>
								<option value="6">2级推荐人佣金</option>
								<option value="7">代理佣金</option>
								<option value="21">推客直推佣金</option>
								<option value="22">管家直推佣金</option>
								<option value="23">主管直推佣金</option>
								<option value="24">超级店主直推佣金</option>
								<option value="25">合伙人直推佣金</option>
								<option value="26">推客团队佣金</option>
								<option value="27">管家团队佣金</option>
								<option value="28">主管团队佣金</option>
								<option value="29">合伙人团队佣金</option>
								<option value="30">拼团一级分佣</option>
								<option value="31">拼团二级分佣</option>
							</select>
						</div>
						<div class="columns pull-right col-md-1 nopadding">
							<input type="text" class=" form-control" id="createTimeEnd" name="createTimeEnd" placeholder="请选择结束日期"
								   onclick="laydate({istime: false, format: 'YYYY-MM-DD'})"
								   style="background-color: #fff;" readonly="readonly"/>
						</div>

						<div class="columns pull-right">
							<label style="font-weight: 700;float: left;padding: 3px 10px;line-height: 2;font-size: 15px">
								<i class="fa fa-exchange"></i>
							</label>
						</div>

						<div class="columns pull-right col-md-1 nopadding">
							<input type="text" class=" form-control" id="createTimeStart" name="createTimeStart" placeholder="请选择开始日期"
								   onclick="laydate({istime: false, format: 'YYYY-MM-DD'})"
								   style="background-color: #fff;" readonly="readonly"/>
						</div>

						<input type="hidden" name="centreId" th:value="${centreId}" th:if="${flag} == '1'">
						<div class="columns pull-right col-md-1 nopadding" th:if="${flag} == '0'">
							<select data-placeholder="商户" class="form-control chosen-select" name="centreId" tabindex="2">
								<option value="">选择商户</option>
								<option th:each="item: ${centreList}" th:text="${item.name}" th:value="${item.centreId}"></option>
							</select>
						</div>
					</div>
					<table id="commissionTable" data-mobile-responsive="true"></table>
				</div>
			</div>
		</div>

		<div>
			<script type="text/javascript">
				var s_resource_h = 'hidden';
				var s_grant_h = 'hidden';
			</script>
		</div>
		<div shiro:hasPermission="finance:commission:resource">
			<script type="text/javascript">
				s_resource_h = '';
			</script>
		</div>

		<div shiro:hasPermission="finance:commission:grant">
			<script type="text/javascript">
				s_grant_h = '';
			</script>
		</div>
	</div>
	<div th:include="include :: footer"></div>
	<script type="text/javascript" src="/js/appjs/finance/commission/commissions.js"></script>
</body>
</html>